<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>5购物车</title>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	</head>
	<body ng-app="myapp" ng-controller="carController" ng-init="loadCarDatas();">
		<!--导航条-->
		<div>
			<ng-include src="'nav.html'"></ng-include>
		</div>
		<!--导航条-->
		
		<div class="container" >
		   <div class="row">
		      <h5>购物车没有商品哦，<a href="1index.html">请继续购物</a></h5>
		   </div>
		</div>
		<div class="container" >
			<div class="row">
				<div class="col-md-8 col-md-offset-2">
					<p>购物车详情</p>
					<table class="table table-bordered">
						<tr>
							<th>编号</th>
							<th>商品</th>
							<th>价格</th>
							<th>数量</th>
							<th>小计</th>
							<th>操作</th>
						</tr>
						<tr ng-repeat="item in cars.items">
							<td class="active">{{$index+1}}</td>
							<td class="success">{{item.goods.pname}}</td>
							<td class="warning">￥{{item.goods.marketPrice}}</td>
							<td class="danger"><input type="number" ng-blur="modifyGoodsQty(item.goods.id,$event)" value="{{item.qty}}" ></td>
							<td class="info">{{item.goods.marketPrice*item.qty|currency:"￥"}}</td>
							<td class="active">
								<button class="btn btn-default" type="button" ng-click="deleteGoodsById(item.goods.id,cars.total,item.goods.marketPrice*item.qty)">删除</button>
							</td>
						</tr>
					</table>
					<div class="col-md-offset-5">
					    <p>商品金额：{{cars.total|currency:"￥"}}</p>
						<button class="btn btn-default" type="button" ng-click="deleteAllGoods()">清空购物车</button>
						<button class="btn btn-default" type="button" ng-click="saveOrder()">提交订单</button>
						
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
<script src="js/angularjs/angular.min.1.5.8.js"></script>
<script src="js/base/base.js"></script>

<script src="js/service/loginService.js"></script>
<script src="js/service/categoryService.js"></script>
<script src="js/service/carService.js"></script>
<script src="js/service/orderService.js"></script>

<script src="js/controller/navController.js"></script>
<script src="js/controller/carController.js"></script>
